﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;

//This entity class models the behavior of a project/prototype object and 
//associates with all information of a prototype project.
namespace ProtoImaginer.ProtoProject
{
    public class Project
    {
        protected enum ProjectStatus { Created, Published, Deleted };
        private Guid id;
        private String name;
        private String description;
        private String tag;
        private int authorId;
        private int categoryId;
        private DateTime createDate;
        private DateTime lastModifiedDate;
        private List<Page> pages; //pages that the prototype contains
        private int noOfPages;
        private int status;

        public Project(Guid id, int authorId)
        {
            this.id = id;
            this.name = "Untitled";
            this.authorId = authorId;
            this.createDate = DateTime.Now;
            this.lastModifiedDate = DateTime.Now;
            this.pages = new List<Page>();
            status = (int)GlobalVariables.projectStatus.Independent;
        }

        public Project(Guid id, String name, int authorId)
        {
            this.id = id;
            this.name = name;
            this.authorId = authorId;
            this.createDate = DateTime.Now;
            this.lastModifiedDate = DateTime.Now;
            this.pages = new List<Page>();
            status = (int)GlobalVariables.projectStatus.Independent;
        }

        public Project(Guid id, String name, int authorId, String description, String keywordString)
        {
            this.id = id;
            this.name = name;
            this.description = description;
            this.authorId = authorId;
            this.createDate = DateTime.Now;
            this.lastModifiedDate = DateTime.Now;
            this.pages = new List<Page>();
            this.tag = keywordString;
            //String[] kwArray = keywordString.Split(';');
            //foreach (String kw in kwArray)
            //{
            //   this.keywords.Add(kw);
            //}
        }

        public void setId(Guid id)
        {
            this.id = id;
        }

        public Guid getId()
        {
            return this.id;
        }

        public void setName(String name)
        {
            this.name = name;
        }

        public String getName()
        {
            return this.name;
        }

        public void setAuthorId(int authorId)
        {
            this.authorId = authorId;
        }

        public int getAuthorId()
        {
            return this.authorId;
        }

        public void setCategoryId(int categoryId)
        {
            this.categoryId = categoryId;
        }

        public int getCategoryId()
        {
            return categoryId;
        }

        public void setCreateDate()
        {
            this.createDate = DateTime.Now;
        }

        public DateTime getCreateDate()
        {
            return this.createDate;
        }

        public String getDescription()
        {
            return this.description;
        }

        public void setLastModifiedDate()
        {
            this.lastModifiedDate = DateTime.Now;
        }

        public DateTime getLastModifiedDate()
        {
            return this.lastModifiedDate;
        }

        public void setPages(List<Page> pages)
        {
            this.pages = pages;
        }

        public List<Page> getPages()
        {
            return this.pages;
        }

        public int getNoOfPages()
        {
            return pages.Count;
        }

        public void setStatus(int status)
        {
            this.status = status;
        }

        public string getKeywords() { return tag; }

        public int getStatus()
        {
            return this.status;
        }

        public void addPage(int projectId, int authorId, int photoId)
        {
            
        }

        public void addPage(int projectId, int authorId, String title, int photoId)
        {

        }
    }
}
